<template>
  <Table :columns="columns" :buttons="buttons"></Table>
</template>
<script lang="ts">
  export default { name: 'DemoIndex' }
</script>
<script setup lang="ts">
  const columns = ref<ColumnsListInterface[]>([
    {
      type: 'seq',
      title: '标题',
      field: 'title',
    },
    {
      title: '标题',
      field: 'title',
    },
    {
      title: '名字',
      field: 'name',
    },
  ])

  const buttons = ref<TableSearchButton[]>([
    {
      label: '新增',
      key: 'add',
    },
    {
      label: '新增',
      key: 'test',
      type: 'primary',
      change: () => {
        return new Promise<void>((resolve, reject) => {
          setTimeout(() => {
            resolve()
          }, 2000)
        })
      },
    },
  ])
</script>
